home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / etc_-_Configuration_Files / POWERD_C.{1E < prev    next >
Text File  |  1999-09-17  |  4KB  |  116 lines

  1. #
  2. # /etc/powerd.conf  for powerd version-2.0 and later.
  3. #
  4. # by Alessandro Rubini
  5. #
  6.  
  7. #   Comment out the following line to actually enable powerd.
  8. #   Otherwise, it will do everything but shutting down (and up) the system.
  9. #   Having it disabled is useful to check network connectivity.
  10.  
  11. disabled
  12.  
  13.  
  14. ############# GENERAL FACILITIES
  15. #
  16. #    The "delay" fiels allows delayed operation. Thus, if the power has a
  17. #    short glitch, you can even avoid scheduling a shutdown, though it
  18. #   will be registered in /var/adm/messages. Note that delaying is not
  19. #   wise if you get information through the net, because glitches has already
  20. #   been removed. Delay is 10 seconds by default.
  21.  
  22. #delay 20
  23.  
  24. #    "debug" avoids forking and prints verbose info on stderr. Otherwise,
  25. #    a daemon is forked and fewer messages go to syslog.
  26.     
  27. debug yes
  28.  
  29. #   "logfile" is used to redirect stderr. Thus you don't have to edit all
  30. #   of your rc files to enable debugging on live tests.
  31. #   Note that if "logfile" is specified, powerd goes to the background
  32. #   independently of "debug". If by chance you have something not going
  33. #   to background in your rc files, the next boot will hand without hope.
  34.  
  35. #logfile /tmp/powerd.log
  36.  
  37. ############# GETTING/PROVIDING INFO THROUGH THE NET
  38. #
  39. #   "remoteserver" is reached to get OK/FAIL.
  40. #   If "serverport" is set but "remoteserver" is not,
  41. #    then *we* are the server
  42.  
  43. #remoteserver godipmec.unipv.it
  44. # serverport 2043
  45.  
  46. #   Connecting to the server may take some time: you can specify a number
  47. #   of trials, and the timeout for each retransmission. You should allow
  48. #   enough time for the server to boot. For Linux is can be as low as a
  49. #   few seconds ;-)
  50.  
  51. # timeout 10
  52. # trials 18
  53.  
  54.  
  55. #   Since udp is connectionless, you should specify a pollingstep. Thus you
  56. #   can re-register to the new remote daemon after server occasional reboots.
  57.  
  58. # pollingstep 180
  59.  
  60. ############# GETTING INFO FROM A SERIAL LINE
  61. #
  62. #   If a simple ups asserts a serial line, use the following lines:
  63. #   "monitor" DCD or DSR or CTS (pins 8,6,5 on 25-pin and 1,6,8 on 9-pin).
  64. #   "failwhen" can be high or low.
  65. #   The default is what powerd-1.1 had hardcoded (DCD high means ok).
  66. # ====> Defaults not working, specify them
  67.  
  68. #serialline    /dev/cua3
  69. # monitor     DCD
  70. # failwhen    low
  71.  
  72. #   If your UPS can be shut down, you can do it here. You can pulse a
  73. #   signal to the ups. Each "assert" force a 1-second sleep.
  74. #   In this example we pulse RTS. A shutdown pulse is only effective when
  75. #   the UPS is battery powered.
  76. #   You can assert RTS or DTR (pins 4,20 on 25-pin and 7,4 on 9-pin).
  77.  
  78. # assertlow   RTS
  79. # asserthigh  RTS
  80.  
  81. #   Monitoring a serial line, requires polling, because select() can't
  82. #   tell about bit change. Thus a polling interval is required.
  83. #   The default is 20. though powerd-1.1. used 2.
  84.  
  85. # pollingstep 20
  86.  
  87. #    Explicit asserion of a bit may be needed to give power to your cable
  88. # asserthigh  DTR
  89.  
  90. ############# GETTING INFO FROM A FIFO
  91. #
  92. #   Reading a fifo is nice to debug your actual setup. You can
  93. #   "echo FAIL > /var/run/upsctl" and then "echo OK". Alternatively,
  94. #   if some other program is providing status info on a file, you can
  95. #   fake it to write a fifo. But be careful, check file permissions.
  96. #    Remember, also, that when the system is down in single-user mode,
  97. #    filesystems other than root are unmounted, and root is read-only.
  98.  
  99. #readfifo /var/run/upsctl
  100. # failwhen FAIL
  101. # okwhen OK
  102.  
  103.  
  104. ############# GETTING INFO FROM AN EXTERNAL MONITOR
  105. #
  106. #   If your ups uses a rela RS-232 connection, you can have your
  107. #   communication prgram which reports OK/FAIL on stdout. If different
  108. #   strings are used just specify them. Support for regexp is missing.
  109.  
  110. #spawnmonitor "/sbin/upsmonitor /dev/ttyS1"
  111. # failwhen FAIL
  112. # okwhen   OK
  113.   
  114.  
  115.  
  116.